home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
pluginy Firefox
/
1035
/
1035.xpi
/
chrome
/
1clickweather.jar
/
content
/
1clickweather
/
js
/
config
/
configmanager.js
< prev
next >
Wrap
Text File
|
2008-10-05
|
1KB
|
62 lines
// ⌐ 2005 The Weather Channel Interactive, Inc. All Rights Reserved.
/*
ConfigManager - Manager object for
application configuration files
*/
function ConfigManager() {
}
// set prototype for ConfigManager
ConfigManager.prototype = {
// THIS METHOD RETURNS THE APP
// CONFIG OBJECT REPRESENTATION
getAppConfig: function() {
var appConfig = new AppConfig();
try {
appConfig.load();
} catch(e) {
alert("ConfigManager.getAppConfig(): " + e);
}
return appConfig;
},
// THIS METHOD RETURNS THE USER
// CONFIG OBJECT REPRESENTATION
getUserConfig: function() {
var userConfig = new UserConfig();
try {
userConfig.load();
} catch(e) {
alert("ConfigManager.getUserConfig(): " + e);
}
return userConfig;
},
// THIS METHOD SETS THE APP
// CONFIG OBJECT REPRESENTATION
setAppConfig: function(newAppConfig) {
try {
newAppConfig.save();
return 1;
} catch(e) {
alert("ConfigManager.setAppConfig(): " + e);
return 0;
}
},
// THIS METHOD SETS THE USER
// CONFIG OBJECT REPRESENTATION
setUserConfig: function(newUserConfig) {
try {
newUserConfig.save();
return 1;
} catch(e) {
alert("ConfigManager.setUserConfig(): " + e);
return 0;
}
}
};